package java_DesignPattern.CreatorPattern.FactoryPattern.SimpleFactoryAndStaticFactory;

/**
 * 咖啡商店类,模拟咖啡商店
 */
public class CoffeStore {

     /**
      * 订单咖啡
      * @param name 咖啡名称
      * @return 咖啡
      */
    public Coffe orderCoffe(String name){

        //如果为非静态工厂模式,需要创建咖啡工厂对象
        /*
        CoffeFactory coffeFactory = new CoffeFactory();
        Coffe coffe = coffeFactory.createCoffe(name);
         */

        //调用静态工厂模式创建咖啡
        return CoffeFactory.createCoffe(name);
    }
}
